package com.lpc.carinfo.view;

import android.app.AlertDialog;
import android.content.Context;
import android.os.Bundle;
import android.view.View;
import android.widget.TextView;

import com.lpc.carinfo.R;


public class MProgressDialog extends AlertDialog {

    private TextView mMessageView;
    private String message;
    private boolean mCancelAble = true;

    public MProgressDialog(Context context, boolean cancelAble) {
        super(context, R.style.MDialog);

        mCancelAble = cancelAble;

    }

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.progress_dialog);

        // ProgressBar mProgress = (ProgressBar)
        // findViewById(android.R.id.progress);
        mMessageView = (TextView) findViewById(R.id.progress_message);
        if (message != null) {
            mMessageView.setVisibility(View.VISIBLE);
            mMessageView.setText(message);
        }
        setCancelable(mCancelAble);
        setCanceledOnTouchOutside(false);

    }

    public void setMessage(String message) {
        this.message = message;

    }
}
